package org.gws.alaska.metamodel.validator

class AlaskaSyntaxProfileValImpl extends AlaskaModelSyntaxValidator{

	@Override
	public Object validateStaticModel(Node rootNode) {

		def cList = rootNode.directChildren;
		// model ha un solo figlio
		if (cList.size() == 1){
			throw new Exception("Validator Error: model struturce")
		}

		def containsNode = cList.get(0);
		stereoNodes = containsNode.directChildren;

		// controlla che ogno stereotipo
		// ha un sintax type ed un extend metaclass
		stereoNodes.each { snode ->
			if ( snode.attributes.size() == 0 ) {
				throw new Exception("Validator Error: model structure")
			}

			if (snode.attributes['extend'] == null || snode.attributes['syntax'] == null){
				throw new Exception("Validator Error: model structure")
			}

			if( snode.attributes['extend'].getClass() != MetaModel){
				throw new Exception("Validator Error: model structure")
			}else{

				if ( snode.attributes['extend'] == MetaModel.UMLClass &&
				snode.attributes['syntax'] != SyntaxType.Boxed){
					throw new Exception("Validation Error: syntax error");
				}
				
				
				
				
				
			}
			if( snode.attributes['extend'].getClass() != SyntaxType){
			}
		}

	}
	@Override
	public Object validateModelInstance(Object modelInstance) {
		throw new Exception("Not support this method")
	}
	@Override
	public Object validateStaticModel(Object model) {
		throw new Exception("Not support this method")
	}

}
